package Intercepting;

import javax.naming.NamingException;

public class ServiceLocatorPatternDemo {
    public static void main(String[] args) throws NamingException {
        Service service = ServiceLocator.getService("Service1");
        service.execute();
        service = ServiceLocator.getService("Service2");
        service.execute();
        service = ServiceLocator.getService("Service1");
        service.execute();
        service = ServiceLocator.getService("Service2");
        service.execute();
    }
}
